/**

 * @class Extmx.DataView
 * 
 * 
 * @extends Ext.DataView
 * @autor Ing. Josue Hernandez Gomez<br>
 *        joshua@extjs.mx<br>
 *        http://www.joshua.com.mx
 * @fecha 25 de septiembre de 2011. DF, M&eacute;xico
 * 
 */
Ext.ns("Extmx.DataView");
Extmx.DataView=Ext.extend(Ext.DataView,{
    loadOnRender: true,
    frame        : false,
    border:false,
    style:'overflow:auto; ',
    singleSelect: true,//seleccionar solo de uno en uno
    
    initComponent: function (){

        this.store=this.store || this.getStore();

        Extmx.DataView.superclass.initComponent.apply(this,arguments);
		this.relayEvents(this.store,["load", "beforeload"]);
    },

    getSeleccionado: function (){
        var t= this.getSelectedRecords();
        if(this.singleSelect && t.length>0)
            return t[0];
        return t;
    },

    getSeleccionados: function (){
        return this.getSelectedRecords();
    },

    hasSelection: function (){
        return !! this.getSelectionCount();
    },

    load: function (){
        this.store.load();
    },

    reload: function (){
        this.store.reload();
    }
});